﻿<!-- 将所有下属的单位全部获取 -->


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>广德县创新创业综合服务网-用户注册</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="keywords" content="广德县创新创业综合服务网-用户注册">
    <meta name="description" content="广德县创新创业综合服务网">

    <link href="css/portal.css" rel="stylesheet" type="text/css">
    <script src="/View/JS/jquery-1.11.2.min.js"></script>
    <script src="js/seajs-jquery.js"></script>
    <script src="js/jquery-ui-1.10.3.custom.min.js"></script>
    <style type="text/css">

    </style>
    <script type="text/javascript">
        $().ready(function () {
            
            $("#zhuce").click(function () {
                var companyname = $.trim($("#companyname").val());
                var linkUser = $.trim($("#linkUser").val());
                var linkMobile = $.trim($("#linkMobile").val());
                var linkMm = $.trim($("#linkMm").val());
                var linkMm2 = $.trim($("#linkMm2").val());

               // alert($("#companyname"))
                //  alert(companyname)
                if (checkform() && regphone(linkMobile)) {
                    $.getJSON("/API/VIEWAPI.ashx?Action=Commanage_ZC&r=" + Math.random(), { P1: $.trim($("#companyname").val()), P2: $.trim($("#linkUser").val()), MOBILE: $.trim($("#linkMobile").val()), PSD: $.trim($("#linkMm2").val()) }, function (resultData) {
                        if (resultData.ErrorMsg == "") {

                            addCookie('username', $("#companyname").val(), 2000)
                            addCookie('userpasd', $("#linkMm2").val(), 2000)
                            alert('注册成功')
                            location.href = "/View/IndexNTab.aspx";
                            //Session["UserName"] = companyname;
                            //Response.Redirect("/View/IndexNTab.aspx", false);
                            //model.nouser = resultData.Result;
                            // model.bz = "3";
                        }
                        else {
                            alert(resultData.ErrorMsg);
                        }
                        //$.getJSON("/API/VIEWAPI.ashx?Action=Commanage_REGISTER&r=" + Math.random(), { P1: ID,"username ",P2:""}, function (resultData) {
                        //    if (resultData.ErrorMsg == "") {
                        //            alert('注册成功')
                        //    }
                    });
                }
                else
                {
                    alert('输入数据有误，请重新输入')
                }
            })

            $("#reset").click(function () {
                $("#companyname").val("");
                //$("#companyname").placeholder("请输入用户登录名称");
                $("#linkUser").val("");
                $("#linkMobile").val("");
                $("#linkMm").val("");
                $("#linkMm2").val("");
              

                // alert($("#companyname"))
                //  alert(companyname)
              
            })

        })
    </script>
</head>
<body style="background-color:#f4f4f4;">

    <form id="autoportal_registB_action" name="autoportal_registB_action" method="post" enctype="multipart/form-data">
        <div class="formBox">
            <div class="formTitle">用户注册</div>
            <span style="color:red;"></span>
            <div style="margin-top:25px;">
                <input autocomplete="off" id="companyname" name="companysreg.companyname" value="" type="text" class="formInput" style="height:40px;font-size: 19px;" placeholder="请输入用户登录名称" />
            </div>
            <span id="yz_companyname" style="color:red;"></span>
            
            
            <div style="margin-top:33px;">
                <input autocomplete="off" type="text" id="linkUser" name="companysreg.linkUser" value="" class="formInput" style="height:40px;font-size: 19px;" placeholder="请输入用户姓名" />
            </div>
            <span id="yz_linkUser" style="color:red;"></span>

            <div style="margin-top:25px;">
                <input autocomplete="off" type="text" id="linkMobile" onchange="regphone(this.value);" name="companysreg.linkMobile" value="" class="formInput" style="height:40px;font-size: 19px;" placeholder="请输入手机号码" />
            </div>
          
            <!--<span id="yz_linkUser" style="color:red;"></span>
            <div style="margin-top:25px;">
                <input autocomplete="off" type="text" id="linkMobile" name="companysreg.linkMobile" value="" class="formInput" style="height:40px;font-size: 19px;" placeholder="请输入邮箱" />
            </div>-->
            <span id="yz_linkMobile" style="color:red;"></span>
            <div style="margin-top:25px;">
                <input autocomplete="off" type="password"  id="linkMm" name="companysreg.linkMm" value="" class="formInput" style="height:40px;font-size: 19px;" placeholder="请输入密码" />
            </div>
            <span id="yz_linkMm" style="color:red;"></span>
           
            <div style="margin-top:25px;">
                <input autocomplete="off" type="password" id="linkMm2" name="companysreg.linkMm2" value="" class="formInput" style="height:40px;font-size: 19px;" placeholder="请再次输入密码" />
            </div>
            <span id="yz_linkMm2" style="color:red;"></span>
            <!--<div style="width:42%;margin: auto;">
                <input autocomplete="off" type="text" id="yzm" name="companysreg.yzm" value="" style="width:50%;height:40px;margin-top: 22px;font-size: 19px;border:1px solid #cfcfcf;" placeholder="请输入密码" />
            </div>-->
            <span id="yz_yzm" style="color:red;"></span>
            <div style="margin:5px 25px 10px 25px;padding-top:30px;border-top:1px solid #d8d8d8;">
                <input type="button"  onclick="return checkform()" value="立即注册" id="zhuce" style="width: 23%;padding:15px;font-size:20px;background: #0294f8;color: #fff;border: none;" />
                <input type="button" value="重置" id="reset" style="width: 20%;padding:15px;font-size:20px;background: #0294f8;color: #fff;border: none;" />

                <!-- <input type="button" name="b" value="测试" onclick="testurl()"/> -->
                <input type="hidden" id="compid" name="companysreg.id" value="" />
                <input type="hidden" id="parentid" name="companysreg.parentid" value="" />
            </div>
        </div>
    </form>




</body>
<script type="text/javascript">
    function checkform()
    {
        var companyname=$.trim($("#companyname").val());
        var linkUser=$.trim($("#linkUser").val());
        var linkMobile=$.trim($("#linkMobile").val());
        var linkMm = $.trim($("#linkMm").val());
        var linkMm2=$.trim($("#linkMm2").val());
       

        if (companyname=='')
        {
            $("#yz_companyname").text("请输入单位名称");
            return false;
        }
        else
        {
            $("#yz_companyname").text("");
        }

        if (linkUser=='')
        {
            $("#yz_linkUser").text("请输入联系人姓名");
            return false;
        }
        else {
            $("#yz_linkUser").text("");
        }

        if (linkMobile=='')
        {
            $("#yz_linkMobile").text("请输入手机号码");
            return false;
        }
        else {
            $("#yz_linkMobile").text("");
        }

        if (linkMm=='')
        {
            $("#yz_linkMm").text("请输入密码");
            return false;
        }
        else {
            $("#yz_linkMm").text("");
        }

        if (linkMm2=='')
        {
            $("#yz_linkMm2").text("请再次输入密码");
            return false;
        }
        else {
            $("#yz_linkMm2").text("");
        }

        if (linkMm != linkMm2) {
            $("#yz_linkMm2").text("两个密码不一致，请重新输入");
            return false;
        }
        else {
            $("#yz_linkMm2").text("");
        }

        return true;
    }
    function regphone(tel){
        var reg = /^0?1[3|4|5|7|8][0-9]\d{8}$/;
        if (reg.test(tel)) {
            //  alert("号码正确~");
            $("#yz_linkMobile").text("");
            return true
        } else {
            $("#yz_linkMobile").text("手机号码验证错误，请重新输入手机号码");
            //alert("号码有误~");
            return false;
        };
    }

    function addCookie(objName, objValue, objHours) {//添加cookie
        var str = objName + "=" + escape(objValue);
        if (objHours > 0) {//为0时不设定过期时间，浏览器关闭时cookie自动消失
            var date = new Date();
            var ms = objHours * 3600 * 1000;
            date.setTime(date.getTime() + ms);
            str += "; expires=" + date.toGMTString();
        }
        document.cookie = str;
    }

</script>


</html>
